{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">填写备注信息</div>
    <div class="layui-card-body">
        <!--<form class="layui-form form-horizontal" action="{:url('admin/manager/add')}" method="post">-->
            <input type="hidden" id="id" name="id" value="{$data.id}" />
            <div class="layui-form-item">
                <label class="layui-form-label">审核备注:</label>
                <div class="layui-form-field-label">
                    <textarea placeholder="请输入审核备注信息" class="layui-textarea" id="beizhu"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn ajax-post pass" >立即提交</button>
                    <button class="layui-btn layui-btn-normal return" >返回</button>
                </div>
            </div>
        <!--</form>-->
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__STATIC__/admin/js/common.js"></script>
<script type="text/javascript">
    layui.use('table', function() {
        var $ = layui.$;

        $(".pass").click(function () {
            layer.confirm('确定通过此条申请？', { icon: 3, title: '提示' }, function(index) {
                layer.close(index);
                var beizhu = $("#beizhu").val();
                var id = $("#id").val();
                $.post('{:url("admin/applyhelp/makeSure")}', { 'id': id ,'beizhu':beizhu }, function(data) {
                    if (data.code == 1) {
                        if (data.url) {
                            layer.msg(data.msg + ' 页面即将自动跳转~');
                        } else {
                            layer.msg(data.msg);
                        }
                        setTimeout(function() {
                            if (data.url) {
                                location.href = '{:url("admin/applyhelp/index")}';
                            } else {
                                location.reload();
                            }
                        }, 1500);
                    } else {
                        layer.msg(data.msg);
                        setTimeout(function() {
                            if (data.url) {
                                location.href = '{:url("admin/applyhelp/index")}';
                            }
                        }, 1500);
                    }

                });
            });
        });


        $(".return").click(function () {
            window.open('{:url("admin/applyhelp/index")}','_self');
        });

    });
</script>
{/block}